<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <!-- <meta http-equiv="X-UA-Compatible" content="IE=edge"> -->
    <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>名医在线医生卡</title>
    <!-- <script src="http://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script> -->
    <script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<p>拉拉拉拉</p>
<script>
    const params = {
        imgUrl: 'https://img.myzx.cn/video/mysource/image/20200904/5f51d3f43c14d.png',
        link: 'http://cs.cards.myzx.cn/test/index.html',
        title: '我是标题',
        desc: '我是描述',
        success(res) {
            alert(JSON.stringify(res))
        }
    }

    function weiXinShare() {
        wx.onMenuShareAppMessage(params)
        wx.onMenuShareTimeline(params)
        wx.onMenuShareQQ(params)
    }

    $(function () {
        $.post(
            'http://cs.cards.myzx.cn/entrance/xcxcards/detail/26',
            { url: location.href },
            res => {
                wx.config({
                    debug: true,
                    // ...res.data.share
                    appId: res.data.share.appId,
                    timestamp: res.data.share.timestamp,
                    nonceStr: res.data.share.nonceStr,
                    signature: res.data.share.signature,
                    jsApiList: [
                        "onMenuShareTimeline","onMenuShareAppMessage","onMenuShareQQ"
                    ]
                })

                wx.ready(function(){
                    weiXinShare()
                })
            }
        )
    })
</script>
</body>
</html>
<style>
</style>
